package io.renren.modules.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * @Author: 蔡翔
 * @Date: 2019/7/4 9:23
 * @Version 1.0
 */
@Service
public class RedisPoolFactory {

    @Bean
    public JedisPool JedisPoolFactory(){
        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
        jedisPoolConfig.setMaxIdle(10);
        jedisPoolConfig.setMaxTotal(10);
        jedisPoolConfig.setMaxWaitMillis(3*1000);

        JedisPool jp = new JedisPool(jedisPoolConfig,"192.168.0.191",
                6379,3*1000,"251128856",0);

        return jp;
    }
}
